#!/bin/sh
#
# Author ： hbaolong@vip.qq.com
#
# Function : 这是一个模板
#
#
#

if [ $# -ne 0 ]; then
	echo "Usage: this is a empty shell."
	exit
fi

workdir="/Users/hbaolong/workshop/gitee/3place"

cd $workdir

TMPFILE=`echo $0|awk -F/ '{print $NF}'``date|sed -e "s/ //g"`.tmp

find . -mnewer reading.md |grep ".md$"  |awk -F:  '{print $1}' > $TMPFILE

grep "^###### 读到这里" `cat $TMPFILE` |awk -F: '{print $1}'>reading.md

cat reading.md |awk -F/ '{print $2}' |uniq >>reading.md

cat reading.md |xargs touch 

for files in `cat reading.md |sed -e "/\//d" `
do
	touch $files/mingju.md
	touch $files/memo.md
done

cat reading.md |sort -g |xargs subl

rm -f $TMPFILE